This invention relates to the compression of digital video, audio or other signals.
Compression encoding generally involves a number of separate techniques. These will usually include a transformation, such as the block-based discrete cosine transform (DCT) of MPEG-2; an optional prediction step; a quantisation step and variable length coding. This invention is particularly concerned in this context with quantisation.
The quantisation step maps a range of original amplitudes onto the same representation level. The quantisation process is therefore irreversible. MPEG-2, (in common with other compression standards such as MPEG-1, JPEG, CCITT/ITU-T Rec.H.261 and ITU-T Rec.H.263) defines representation levels and leaves undefined the manner in which the original amplitudes are mapped onto a given set of representation levels.
In general terms, a quantizer assigns to an input value, which may be continuous or may previously have been subjected to a quantisation process, a code usually selected from quantization levels immediately above and immediately below the input value. The error in such a quantization will generally be minimised if the quantization level closest to the input value is selected. In a compression system, it is further necessary to consider the efficiency with which respective quantization levels may be coded. In variable length coding, the quantization levels which are employed most frequently are assigned the shortest codes.
Typically, the zero level has the shortest code. A decision to assign a higher quantization level, on the basis that it is the closest, rather than a lower level (and especially the zero level) will therefore decrease coding efficiency. In MPEG2, the overall bit rate of the compressed signal is maintained beneath a pre-determined limit by increasing the separation of quantization levels in response to a tendency toward higher bit rate. Repeated decisions to assign quantization levels on the basis of which is closest, may through coding inefficiency thus lead to a coarser quantization process.
The behaviour of a quantizer in this respect may be characterised through a parameter xcex which is arithmetically combined with the input value, with one value of xcex (typically xcex=1) representing the selection of the closest quantization level or xe2x80x9croundingxe2x80x9d. A different value of xcex (typically xcex=0) will in contrast represent the automatic choice of the lower of the two nearest quantization levels, or xe2x80x9ctruncatingxe2x80x9d. In the MPEG2 reference coder, an attempt is made to compromise between the nominal reduction in error which is the attribute of rounding and the tendency toward bit rate efficiency which is associated with truncating, by setting a standard value for xcex of xcex=0.75.
Whilst particular attention has here been paid to MPEG2 coding, similar considerations apply to other methods of compression encoding of a digital signal, which including the steps of conducting a transformation process to generate values and quantising the values through partitioning the amplitude range of a value into a set of a adjacent intervals, whereby each interval is mapped onto a respective one of a set of representation levels which are to be variable length coded, such that a bound of each interval is controlled by a parameter xcex. The transformation process may take a large variety of forms, including block-based transforms such as the DCT of MPEG2, and sub-band coding.
It is an object of one aspect of the present invention to provide an improvement in such a method which enables higher quality to be achieved at a given bitrate or a reduction in bitrate for a given level of quality.
Accordingly, the present invention is in one aspect characterised in that xcex is controlled so as to vary dynamically the bound of each interval with respect to the associated representation level.
Suitably, wherein each value is arithmetically combined with xcex.
Advantageously, xcex is:
a function of the quantity represented by the value;
where the transformation is a DCT, a function of horizontal and vertical frequency;
a function of the quantisation step size; or
a function of the amplitude of the value.
In a particular form of the present invention, the digital signal to be encoded has been subjected to previous encoding and decoding processes and xcex is controlled as a function of a parameter in said previous encoding and decoding processes.
In a further aspect, the present invention consists in a (q, xcex) quantiser operating on a set of transform coefficients xk representative of respective frequency indices fk in which xcex is dynamically controlled in dependence upon the values of xk and fk.
Advantageously, xcex is dynamically controlled to minimise a cost function D+xcexcH where D is a measure of the distortion introduced by the quantisation in the uncompressed domain and H is a measure of compressed bit rate.